import React from 'react';
import { useHistory } from "react-router-dom";
import './index.css';

function Case(props) {
  const history = useHistory();

  function check(){
    history.push('detail?id='+props.id)
    console.log(props)
    localStorage.setItem('step1',props.content[props.id][1][0]);
    localStorage.setItem('step2',props.content[props.id][1][1]);
    localStorage.setItem('step3',props.content[props.id][1][2]);
    localStorage.setItem('step4',props.content[props.id][1][3]);
  }
  return (
  <div className='case-item'>
    <div className='item-name'>
      {props.detail}
    </div>
    <div className='check-button' onClick={check}>查看</div>
  </div>
  );
}

export default Case;
